home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shadez.swf / scripts / Local / Game / Thing / CShotTankShell.as < prev    next >
Text File  |  2011-08-19  |  2KB  |  80 lines

  1. package Local.Game.Thing
  2. {
  3.    import Local.Game.World.CAngle;
  4.    import Local.Game.World.CPosition;
  5.    import flash.geom.Matrix;
  6.    
  7.    public class CShotTankShell extends CShot
  8.    {
  9.        
  10.       
  11.       public function CShotTankShell(param1:CPosition, param2:CAngle)
  12.       {
  13.          super(param1);
  14.          Process = Process_Normal;
  15.          mAngle = param2;
  16.          mMaxSpeed = mSpeed = 50;
  17.          mDelta = mAngle.GetDelta(mSpeed);
  18.          mDestination = new CPosition();
  19.          mShowOnMap = true;
  20.          AddAnimation("stand",TankShell,"AddSprite_Black");
  21.       }
  22.       
  23.       public function Process_Die() : *
  24.       {
  25.          if(true)
  26.          {
  27.             DispatchDispose();
  28.          }
  29.       }
  30.       
  31.       override public function Draw() : void
  32.       {
  33.          var _loc1_:Matrix = null;
  34.          if(true)
  35.          {
  36.             super.Draw();
  37.             DrawTrail(3,100);
  38.          }
  39.          _loc1_ = GetOrientationMatrix();
  40.          DrawSprite(_loc1_);
  41.       }
  42.       
  43.       public function Process_Normal() : void
  44.       {
  45.          var _loc1_:CPosition = null;
  46.          var _loc2_:Array = null;
  47.          var _loc3_:CThingMain = null;
  48.          if(true)
  49.          {
  50.             mDelta = mAngle.GetDelta(mSpeed);
  51.             if(true)
  52.             {
  53.                mDestination.x = mPosition.x + mDelta.x;
  54.             }
  55.             mDestination.y = mPosition.y + mDelta.y;
  56.          }
  57.          _loc1_ = mLandscape.CollideLine(mPosition.x,mPosition.y,mDestination.x,mDestination.y);
  58.          if(_loc1_ != null)
  59.          {
  60.             mDestination.Copy(_loc1_);
  61.             Process = Process_Die;
  62.          }
  63.          _loc2_ = GetThings_Line(mPosition,mDestination,1);
  64.          if(_loc2_.length)
  65.          {
  66.             _loc3_ = _loc2_[0];
  67.             mDestination.Copy(_loc3_.mCollide.CollideLine(mPosition,mDestination));
  68.             AddThing(new CEffectExplosionMedium(mPosition));
  69.             Process = Process_Die;
  70.          }
  71.          mPosition.Copy(mDestination);
  72.          MapMoveTrail();
  73.          if(!mMap.InMap(mPosition.x,mPosition.y))
  74.          {
  75.             Process = Process_Die;
  76.          }
  77.       }
  78.    }
  79. }
  80.